<?php

namespace api\wxapp\model;

use think\Model;
use think\Validate;
class User extends Model
{
    protected $table = 'sssc_app_user';
    public function returnfield($query)
    {
        return $query->field('id,nickname,img,integral,addtime');
    }
    public function info($uid)
    {
        return self::get($uid);
    }
    //模型验证
    public function check($data)
    {
        $validate = new Validate([
            'nickname'  => 'require',
            'img' => 'require',
            'openid' => 'require',
        ]);
        if(!$validate->check($data)){
            return $validate->getError();
        }
    }
}
